import { reactive } from "vue";
import type { FormRules } from "element-plus";
//import { isPhone, isEmail } from "@pureadmin/utils";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
  tableName: [{ required: true, message: "请输入源表名称", trigger: "blur" }],
  classID: [
    {
      validator: (rule, value, callback) => {
        console.log(value, "value");
        if (value === "") {
          callback();
        } else {
          callback();
        }
      },
      trigger: "blur"
    }
  ]
});

export const appInfoRules = reactive(<FormRules>{
  appName: [{ required: true, message: "请输入应用名称", trigger: "blur" }],
  appImage: [{ required: true, message: "请选择图标", trigger: "blur" }],
  appRange: [{ required: true, message: "请选择类别", trigger: "blur" }],
  appPath: [{ required: true, message: "请选择应用模型", trigger: "blur" }]
});
